package com.xingyun.app.data.api.service;

import com.xingyun.app.data.entity.LoginJson;
import com.xingyun.app.data.entity.TodayArticleResponse;
import com.xingyun.app.data.entity.VideoResponse;

import java.util.Map;

import io.reactivex.Observable;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;

/**
 * Created by Cyw on 2017/11/22.
 */

public interface ApiService {


    @FormUrlEncoded
    @POST("android/login/login.do?action=submitEncryptionTest")
    Observable<LoginJson> login(
            @FieldMap Map<String, Object> params
    );

    /**
     * 获取内涵段子的数据
     * @param content_type 数据类型，目前推荐的是-101，视频的是-104，段友秀的是-301，图片的是-103，段子的是-102
     * @param am_loc_time 当前请求的时间
     * @return
     */
    @GET("neihan/stream/mix/v1/?mpic=1&webp=1&essence=1&message_cursor=-1&am_longitude=110&am_latitude=120&am_city=%E5%8C%97%E4%BA%AC%E5%B8%82&count=30&screen_width=1450&do00le_col_mode=0&iid=3216590132&device_id=32613520945&ac=wifi&channel=360&aid=7&app_name=joke_essay&version_code=612&version_name=6.1.2&device_platform=android&ssmix=a&device_type=sansung&device_brand=xiaomi&os_api=28&os_version=6.10.1&uuid=326135942187625&openudid=3dg6s95rhg2a3dg5&manifest_version_code=612&resolution=1450*2800&dpi=620&update_version_code=6120")
    Observable<VideoResponse> getJokes(@Query("content_type")String content_type, @Query("am_loc_time")String am_loc_time);

    /**
     * 每日一文
     * @param data
     * @return
     */
    @Headers({"User-Agent: Mozilla/5.0"})
    @GET("article/day?dev=1")
    Observable<TodayArticleResponse> getArticle(@Query("date")String data);
}
